<template>
    <!-- 复用考试 -->
    <div class="addExamMain">
        <div class="addExamContent">
            <h3 style="padding-bottom:10px;">请选择复用模板科目</h3>
            <div class="copyexamcontent">
                <ul>
                    <li v-for="item in copyexamsuject">
                        <div>{{item.navsname}}<span>{{item.createdate}}创建</span></div>
                        <p ><em v-for="sub in item.nav6s" @click="copyexamSubject(sub.nav6id)">{{sub.nav6name}}</em></p>
                    </li>
                </ul>
            </div>
            <div class="groupbutton">
                <el-button type="" @click="gobackclose">关闭</el-button>
            </div>
        </div>
    </div>
</template>

<script>
import {copyexamlistubject,savemodelflagcase} from '../../api/api.js'
export default {
	props:['subjectid','examnavid','subjectidname'],
    data(){
        return{
            copyexamsuject:[]
        }
    },
	mounted(){
	    this.subjectlistcopy()
	},
    methods:{
		//获取学科列表
		subjectlistcopy(){
		    copyexamlistubject().then(res=>{
		        if(res.code==0){
					this.copyexamsuject = res.obj
				}
		    })
		},
		copyexamSubject(id){
			let obj={
				navid:id,
				newnav6id:this.subjectidname
			}
			savemodelflagcase(obj).then(res=>{
			    if(res.code==0){
 					this.$emit('copyexamclick',1)
				}else{
					this.$message.error(res.msg)
					this.$emit('copyexamclick',0)
				}
			})
		},
        gobackclose(){
            this.$emit('copyexamclick',0)
        }
    }
}
</script>

<style scoped>
.addExamMain{
		position: fixed;
		width:100%;
		height:100%;
		background:rgba(0,0,0,0.5);
		left:0;
		top:0;
		z-index:1000;
	}
	.addExamContent{
		width: 584px;
		height: auto;
		background: #FFFFFF;
		box-shadow: 0px 4px 16px 0px rgba(85,114,146,0.1);
		border-radius: 10px;
		position: fixed;
		left:50%;
		top:50%;
		transform: translate(-50%,-50%);
		z-index:999;
		box-sizing: border-box;
		padding:30px;
	}
	.addExamContent h3{
		font-size:18px;
		padding-bottom:20px;
	}
	.addExamContent ul.muchcommentlist li{
		display: flex;
		align-items: center;
		padding-bottom:14px;
		font-size:14px;
	}
	.addExamContent ul.muchcommentlist li span{
		font-size:14px;
		width:98px;
		color: #557292;
		text-align: right;
	}
	.addExamContent ul.muchcommentlist li p{
		position: relative;
	}
	.addExamContent ul.muchcommentlist li p em{
		position: absolute;
		right:10px;
		top:50%;
		transform: translateY(-50%);
		color:#C0C4CC;
		cursor: pointer;
	}
	.addExamContent ul.muchcommentlist li >>>.el-input__inner{
		width: 400px;
		height: 34px;
		border-radius: 10px;
		border: 1px solid #D8E4F0;
	}
    .tabletabcopy{
		display: flex;
		align-items: center;
		width: 252px;
		height: 30px;
		background: rgba(41,92,255,0.06);
		border-radius: 4px;
		border: 1px solid #295CFF;
	}
	.tabletabcopy li{
		width:84px;
		border-right:solid 1px #295CFF;
		line-height:30px;
		font-size:14px;
		color:#295CFF;
		text-align: center; 
		cursor: pointer;
	}
	.tabletabcopy li:last-child{
		border-right:none;
	}
	.tabletabcopy li.hover,.tabletabcopy li:hover{
		background:#295CFF;
		color:#fff;
	}
	.copyexamcontent{
		height:300px;
		overflow-y: auto;
		overflow-x: hidden;
	}
	.copyexamcontent::-webkit-scrollbar {
		 width:4px;
		background-color: #eee;
		border-radius:10px;
	}
	.copyexamcontent::-webkit-scrollbar-track {
		background-color: #eee;
		border-radius:10px;
	}
	.copyexamcontent::-webkit-scrollbar-thumb {
		background: #619CF5;
		border-radius: 10px;
	}
	.copyexamcontent ul{
		
	}
	.copyexamcontent ul li{
		padding:24px 0;
		border-bottom:solid 1px #EFF1F4;
		cursor: pointer;
	}
	.copyexamcontent ul li div{
		font-size:16px;
		color:#2A303B;
	}
	.copyexamcontent ul li div span{
		color:#557292;
		font-size:12px;
		padding-left:8px;
	}
	.copyexamcontent ul li p{
		font-size:14px;
		color:#295CFF;
		padding-top:10px;
	}
	.copyexamcontent ul li p em{
		font-style: normal;
		margin-right:10px;
	}
	.addExamContent >>> .el-upload-dragger{
		width:522px;
	}
    .groupbutton{
		display: flex;
		align-items: center;
		padding-top:20px;
	}
	.groupbutton >>> .el-button{
		width: 124px;
		height: 34px;
		background: #295CFF;
		border-radius: 10px;
		font-size: 14px;
		color: #FFFFFF;
		padding:0;
	}
	.groupbutton >>> .el-button:last-child{
		background: #F2F6FB;
		border-radius: 10px;
		border: 1px solid #295CFF;
		color:#295CFF;
		margin-left:24px;
	}
</style>